-
Notifications
You must be signed in to change notification settings - Fork 124
[Feature]: Save additional metrics to SR report for all annotations #460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[Feature]: Save additional metrics to SR report for all annotations #460
Conversation
✅ Deploy Preview for dcmjs2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@sedghi Could you please review this or suggest anyone that can help with approving the PR in dcmjs? |
|
@sen-trenser - could you:
|
|
@wayfarer3130 We found some errors when run dciodvfy on the example dcm file. Currently resolving these errors. |
|
@wayfarer3130
|
|
@wayfarer3130 We had some modifications to fix errors reported by the dciodvfy tool. Could you please check the attached data @nithin-trenser provided above? Please check the area marked with text |
|
There is the concept of INFERRED FROM allowing references to a common layout to be used - that basically looks like below: (0040,a730) SQ (Sequence with undefined length #=3) # u/l, 1 ContentSequence (fffe,e000) na (Item with undefined length #=6) # u/l, 1 Item 2: NUM Measurement #1 (fffe,e000) na (Item with undefined length #=6) # u/l, 1 Item 3: NUM Measurement #2 |
|
@pieper - for the saving of SR annotations, I'm proposing that second and subsequent measurements use references to the annotation definition in the first measurement value - that is, a structure like: measurement value 1: The TID 1500 canonical way I believe is: As I read part 16, I THINK either way is acceptable, but I'm not 100% sure. The point in either one is to avoid duplicating the image/graphic data references so that there is no chance that they are different. That is only done when they actually ARE the same - things like bidirectional are not the same annotations first/second. Might ask David what he thinks about this? I'd very much prefer not to go down something not standards compliant. |
|
@wayfarer3130 |
| ]; | ||
| if (radius) { | ||
| measurements.push({ | ||
| RelationshipType: "CONTAINS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this as it is, but it would be nice to have simple helper classes that just constructed this object via arguments, eg:
measurements.push(new RadiusReference(radius, annotationIndex))
Or maybe RadiusMeasuredValue.
| ]; | ||
|
|
||
| if (max) { | ||
| measurements.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, all of these would become simpler if you just reference a structure class like MaximumValueReference(max, modalityUnit, annotationIndex)
| use3DSpatialCoordinates | ||
| }); | ||
|
|
||
| const graphicContentSequence = buildContentSequence({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely find the new version easier to read
| ]); | ||
| ]; | ||
|
|
||
| if (max) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might even extract the full set of reference values here as a standard extractor for "area" measurements rather than including it in each measurement type. Again, not required, just suggesting ways to clean things up a bit more.
| * Builds a DICOM SR ContentSequence block for geometric measurements | ||
| * that share the same structure across tools (Circle, Ellipse, Polyline, etc.) | ||
| */ | ||
| export default function buildContentSequence({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pieper - is there a better name for this that says exactly what this does? content sequence is a bit too generic.
Also, the general dcmjs pattern for this is as a constructor.
How about:
class Tid320ContentItem
constructor({
graphicType,
graphicData,
use3DSpatialCoordinates = false,
referencedSOPSequence,
referencedFrameOfReferenceUID}
and then assign to this.
I believe that meets the pattern.
| if (!codingUnit) { | ||
| log.error("Unspecified units", units); | ||
| return MM_UNIT; | ||
| return generateUnitMap(units); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much as I like this change, it isnt actually valid and can result in ill defined units.
You can expand the list of UCUM units that are available, but not create a new one arbitrarily. If you want to do it this way, then use coding scheme designator "99dcmjsUnit and omit the scheme version, or set it to the version this got added in.
wayfarer3130
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two nice to haves to extract the functionality for creating TID320 content items and sets of content items, and one must change to avoid creating invalid UCUM units.
Context
Changes & Results
What are the effects of this change?
The following tools in Cornerstone3D, Length, Bidirectional, Ellipse, Circle, Rectangle, and Freehand now include all annotation metrics without requiring rendering.
This feature applies only to newly created SRs. Existing SR files will not reflect these changes unless re-saved.
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment